1. Field of the Invention
The present invention relates to an image processing technique for processing line drawings in diagrams and document images.
2. Description of the Related Art
Recently, image data are often digitized and reused to satisfy demands for reduction in the amount of paper being used. In a typical method for reusing image data, the image data are binarized and then converted into vector data using a vectorization technique. Then, the obtained vector data may be used by CAD software or the like.
A method for vectorizing a binary image is discussed in, for example, U.S. Pat. No. 6,404,921 (Japanese Patent No. 3026592), which is assigned to the assignee of this application. According to the method discussed in U.S. Pat. No. 6,404,921, states of a target pixel and pixels adjacent thereto in image data are stored, and the target pixel is extracted in the sequence of raster scanning while horizontal and vertical pixel-arranging vectors are detected on the basis of the states of the target pixel and the pixels adjacent thereto. A state of connection between the pixel-arranging vectors is determined, and a contour of the image data is extracted according to the determined state of connection between the pixel-arranging vectors.
According to the method discussed in U.S. Pat. No. 6,404,921, all of the contour lines included in an image can be extracted by a single raster scanning process. In addition, it is not necessary to use an image memory that can store all of the image data. Therefore, the capacity of the memory can be reduced.
In addition, according to Japanese Patent Laid-Open No. 5-108823 filed by the assignee of this application, contour points can be efficiently extracted by modularizing the rules of vector extraction discussed in U.S. Pat. No. 6,404,921.
On the other hand, U.S. Pat. No. 5,878,161 (Japanese Patent No. 3049672) assigned to the assignee of this application describes an image processing apparatus for providing a high-quality image whose magnification is varied using contour information of a binary image. According to U.S. Pat. No. 5,878,161, outline vectors are extracted from a binary image and are subjected to a magnification-varying process so that the magnification of the outline vectors is smoothly changed to a desired (arbitrary) magnification. Then, the thus-processed outline vectors are used to regenerate a binary image, so that a high-quality, digital binary image whose magnification is arbitrarily varied can be obtained. To extract the outline vectors from the binary image, methods discussed in, for example, U.S. Pat. No. 6,404,921 and Japanese Patent Laid-Open No. 5-108823 can be used.
In addition, Japanese Patent Laid-Open No. 2005-346137 filed by the assignee of this application discusses a method for performing function approximation of contour information of a binary data to express a high-quality image whose magnification is varied with a smaller amount of data. In this method, the contour information is approximated not only with straight lines but also with second or third order Bezier curves.
FIGS. 2A to 2D show the states of data in a process of obtaining a high-quality digital binary image whose magnification is changed to a desired magnification. In this process, first, outline vectors are extracted from a binary image and are smoothly approximated with functions. Then, the outline vectors which are approximated with functions are used to change the magnification of the binary image. FIG. 2A shows an example of a line-art image that is input. FIG. 2B shows a contour image obtained by visualizing contour vector data that is extracted from the binary image shown in FIG. 2A using the method described in U.S. Pat. No. 6,404,921 or Japanese Patent Laid-Open No. 5-108823. FIG. 2C shows an image obtained by visualizing the outline vectors obtained as a result of function approximation of the extracted contour vector data using the method described in U.S. Pat. No. 5,878,161. FIG. 2D shows an example of a high-quality digital binary image whose magnification is changed to a desired magnification, the image being obtained by filling an area surrounded by the vectors after the smoothing (function approximation) process.
To satisfy the above-described demands for reduction in the amount of paper being used, digitization and reuse of image data included in business documents are also demanded. The image data can be reused by, for example, changing the magnification of each portion of the original image to a desired magnification without changing the relative differences in the thickness, areas, etc. In other words, a relatively thick portion in the original image remains relatively thick and a relatively thin portion in the original image remains relatively thin after the magnification-varying process. In this case, the combination of U.S. Pat. No. 5,878,161 and one of U.S. Pat. No. 6,404,921 and Japanese Patent Laid-Open No. 5-108823, or the combination of Japanese Patent Laid-Open No. 2005-346137 and one of U.S. Pat. No. 6,404,921 and Japanese Patent Laid-Open No. 5-108823 can be used to extract the contour (outline) vectors of a binary image included in the original document. Then, the magnification of the two-dimensional image is changed to an arbitrary magnification.
However, when the image data is reused in a business document or in a CAD/CAM system, there may be a case in which it is more advantageous to express each line included in a drawing as a simple line (a straight line, an open curve, a closed curve, etc.) having no width information (information regarding the thickness and area of the line) instead of expressing it with two contour lines, i.e., an outer contour line and an inner contour line.
In addition, there is also an increasing demand to reuse line images drawn only with thin lines without attaching any importance to the thickness thereof. When such a line image is reused, an editing process of, for example, partially changing the curvature or length of the lines, deleting some of the lines, adding other lines, etc., is often performed before reusing the image.
According to the methods described in U.S. Pat. No. 6,404,921 and Japanese Patent Laid-Open No. 5-108823, all of contour lines included in a binary image can be extracted from the binary image that is stored in the sequence of raster scanning. However, line images drawn only with thin lines without attaching any importance to the thickness thereof and lines included in a certain drawing cannot be extracted as a group of closed curves and individual lines connecting terminal points and intersections. In FIG. 2C, which shows the outline vectors obtained by the above-described known method, each of the lines included in the drawing is expressed with an outer contour line and an inner contour line. In the case of extracting, for example, a group of closed graphic elements defined by lines connecting the terminal points or intersections from the outline vectors shown in FIG. 2C, if the extraction is performed using only the outer contour lines, lines cannot be divided from each other at the intersections and only one element is obtained. In addition, if the extraction is performed using only the inner contour lines, there is a possibility that segments connecting the graphic elements and contour vectors corresponding to portions protruding from the closed graphic elements will be eliminated, as shown in FIG. 2E.